﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ThreadBase.cs" company="">
//   
// </copyright>
// <summary>
//   The thread base.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DbDiff.WinClient.Helper
{
    using System;
    using System.Threading;

    /// <summary>
    /// The thread base.
    /// </summary>
    public abstract class ThreadBase : ICustomThread
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ThreadBase"/> class.
        /// </summary>
        public ThreadBase()
        {
            this.Thread = new Thread(new ThreadStart(this.Start));
        }

        #endregion Constructors

        #region Fields & properties

        /// <summary>
        /// Gets Thread.
        /// </summary>
        public Thread Thread { get; protected set; }

        #endregion Fields & properties 

        #region IWorkerThread Members

        /// <summary>
        /// The start.
        /// </summary>
        public abstract void Start();

        /// <summary>
        /// The cancel.
        /// </summary>
        /// <exception cref="NotImplementedException">
        /// </exception>
        public virtual void Cancel() 
        {
            throw new NotImplementedException("ERROR: ItemLoadThreadHelper.Cancel() is not implemented!");
        }
        
        #endregion
    }
}